import request from '@/utils/request'

// 查询用户积分等级规则列表
export function listLevel(query) {
  return request({
    url: '/level/level/list',
    method: 'get',
    params: query
  })
}

// 查询用户积分等级规则详细
export function getLevel(id) {
  return request({
    url: '/level/level/' + id,
    method: 'get'
  })
}

// 新增用户积分等级规则
export function addLevel(data) {
  return request({
    url: '/level/level',
    method: 'post',
    data: data
  })
}

// 修改用户积分等级规则
export function updateLevel(data) {
  return request({
    url: '/level/level',
    method: 'put',
    data: data
  })
}

// 停用用户积分等级规则
export function disableLevel(id) {
  return request({
    url: '/level/level/disable/' + id,
    method: 'delete'
  })
}

// 启用用户积分等级规则
export function enableLevel(id) {
  return request({
    url: '/level/level/enable/' + id,
    method: 'put'
  })
}
